//- Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. 
//- <https://www.chatopera.com>, Licensed under the Chunsong Public 
//- License, Version 1.0  (the "License"), https://docs.cskefu.com/licenses/v1.html
//- Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//- Copyright (C) 2018-Jun. 2023 Chatopera Inc, <https://www.chatopera.com>
//- Licensed under the Apache License, Version 2.0
//- http://www.apache.org/licenses/LICENSE-2.0
ul.layui-nav.layui-nav-tree(lay-filter='setting')
    if user.roleAuthMap["A08_A01"] || user.admin
        li.layui-nav-item.layui-nav-itemed
            a.layui-nav-title(href="javascript:;") 会话信息
            dl.layui-nav-child
                if user.roleAuthMap["A08_A01_A01"] || user.admin
                    dd(class={'layui-this': subtype == 'history'})
                        a(href="/service/history/index.pug") 历史会话
                if user.roleAuthMap["A08_A01_A02"] || user.admin
                    dd(class={'layui-this': subtype == 'current'})
                        a(href="/service/current/index.pug") 当前会话
                if user.roleAuthMap["A08_A01_A03"] || user.admin
                    dd(class={'layui-this': subtype == 'filter'})
                        a(href="/service/quene/index.pug") 排队队列
                if user.roleAuthMap["A08_A01_A04"] || user.admin
                    dd(class={'layui-this': subtype == 'leavemsg'})
                        a(href="/service/leavemsg/index.pug") 访客留言
    if user.roleAuthMap["A08_A02"] || user.admin
        li.layui-nav-item.layui-nav-itemed
            a.layui-nav-title(href="javascript:;") 统计功能
            dl.layui-nav-child
                if user.roleAuthMap["A08_A02_A01"] || user.admin
                    dd(class={'layui-this': subtype == 'statcoment'})
                        a(href="/service/stats/coment.pug") 满意度统计
                if user.roleAuthMap["A08_A02_A02"] || user.admin
                    dd(class={'layui-this': subtype == 'statagent'})
                        a(href="/service/stats/agent.pug") 客服坐席
    if user.roleAuthMap["A08_A03"] || user.admin
        li.layui-nav-item.layui-nav-itemed
            a.layui-nav-title(href="javascript:;") 服务小结
            dl.layui-nav-child
                if user.roleAuthMap["A08_A03_A01"] || user.admin
                    dd(class={'layui-this': subtype == 'agentsummary'})
                        a(href="/apps/agent/summary/index.pug") 多媒体客服
                if user.roleAuthMap["A08_A03_A02"] || user.admin
                    dd(class={'layui-this': subtype == 'processed'})
                        a(href="/apps/agent/processed/index.pug") 已处理多媒体客服
                if user.roleAuthMap["A08_A03_A03"] || user.admin
                    if models.contains("callcenter")
                        dd(class={'layui-this': subtype == 'summary'})
                            a(href="/apps/callcenter/summary/index.html") 呼叫中心
                if models.contains("callcenter")
                    if user.roleAuthMap["A08_A03_A04"] || user.admin
                        dd(class={'layui-this': subtype == 'callcenterprocessed'})
                            a(href="/apps/callcenter/processed/index.html") 已处理呼叫中心
    if user.roleAuthMap["A08_A01_A05"] || user.admin
        li.layui-nav-item.layui-nav-itemed
            a.layui-nav-title(href="javascript:;") 满意度评价
            dl.layui-nav-child
                dd(class={'layui-this': subtype == 'comment'})
                    a(href="/service/comment/index.html") 在线客服
                if models.contains("callcenter")
                    dd(class={'layui-this': subtype == 'callentercomment'})
                        a(href="/apps/callcenter/comment/index.html") 语音通话
    if user.roleAuthMap["A08_A04"] || user.admin
        li.layui-nav-item.layui-nav-itemed
            a.layui-nav-title(href="javascript:;") 坐席信息
            dl.layui-nav-child
                if user.roleAuthMap["A08_A04_A01"] || user.admin
                    dd(class={'layui-this': subtype == 'onlineagent'})
                        a(href="/service/agent/index.html") 在线坐席
                if user.roleAuthMap["A08_A04_A02"] || user.admin
                    dd(class={'layui-this': subtype == 'userlist'})
                        a(href="/service/user/index.html") 全部坐席
